#pragma once
#include "Frame.h"

#include "..\..\SGD Wrappers\SGD_Handle.h"
#include "..\..\SGD Wrappers\SGD_Geometry.h"

#include <vector>

class Animation
{
public:
	Animation(bool loop = true);
	Animation(const Animation& copy);
	~Animation();

	// Accessors
	SGD::HTexture& GetImage();
	Frame& GetFrame();
	int GetCurrentFrame();
	SGD::Rectangle GetCollisionRect(SGD::Point position);
	SGD::Rectangle GetDrawRect();
	bool IsLooping();
	bool IsPlaying();
	float GetTopCollision();
	float GetRightCollision();
	float GetLeftCollision();
	float GetScale();

	// Mutators
	void SetScale(float scale);
	void SetImage(SGD::HTexture image);
	void Clear();
	void AddFrame(Frame frame);
	void SetCurrentFrame(int frame);
	void IsLooping(bool loop);
	void IsPlaying(bool play);

	void Update(float dt);
	void Render(SGD::Point position);

private:
	SGD::HTexture pImage = SGD::INVALID_HANDLE;
	bool bIsLooping;
	bool bIsPlaying;
	int iCurFrame;
	float fScale;
	std::vector<Frame> vFrames;
};

